<script type="text/javascript">
  var str = '"a", "b"';
  document.write(str.replace(/"([^"]*)"/g, "'$1'"));
</script>